<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 6. 身份证检测  百度：身份证的格式 18Wei  1. 1-8 2. 1-6
        var str = prompt()
        var reg = /^[0-8][1-6][0-7]|9\d$/
        console.log(reg.test(str))

    </script>
</body>
</html>